//（从[1,2,3,4,5]到[1,2].[3,4].[5]）
const arr = [1, 2, 3, 4, 5]
function trans(arr) {
    const result = []
      for (let i = 0; i < arr.length; i += 2) {
        result.push(arr.slice(i, i + 2)); //截取
    }
    return result
}
console.log(trans(arr));
